/***************************************************************************
 *   Copyright (C) 2009 by Bernhard Neuhofer   *
 *   mail@bneu.at   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef TAXISTAND_H
#define TAXISTAND_H

using namespace std;

#include <iostream>
#include <vector>

#include "modelentity.h"
#include "taxiArrivalInterpreter.h"
#include "customerArrivalInterpreter.h"
#include "taxtArrival.h"
#include "CustomerArrival.h"
/**
* @brief Taxistand is a model which unserstands TaxiArrival and CustomerArrival messages.
*/
class  TaxiStand:public ModelEntity,TaxiArrivalInterpreter,CustomerArrivalInterpreter
{
private:
/** The number of customers waiting at the taxistand*/
unsigned int _nrCustomers;
/** The number of taxis waiting at the taxistand */
unsigned int _nrTaxis;
/** Time for taxi to reach the next taxistand, mu*/
static const double NORMAL_DIST_MU=5.0;
/** Time for taxi to reach next taxistand, sigma */
static const double NORMAL_DIST_SIGMA=0.2;
public:

/**
 * Constructor for Taxistand 
 * @see ModelEntity#ModelEntity
 * @param assocLp 
 * @param neighbors 
 */
TaxiStand(AbstractLp* assocLp,vector<unsigned int> neighbors) :ModelEntity(assocLp,neighbors){}

/**
 * Execute the arrival of a taxiarrivalmessage.
 * @param message 
 */
virtual void execute(TaxiArrival* message);
/**
 * Execute the arrival of a customerarrival message.
 * @param message 
 */
virtual void execute(CustomerArrival* message);
/**
 * Get the number of waiting customers
 * @return nrCustomer The number of waiting customers
 */
virtual unsigned int getNrCustomers();
/**
 * Get the number of waiting taxis
 * @return nrTaxis The number of waiting taxis
 */
virtual unsigned int getNrTaxis();
/**
 * Set the number of waiting customers
 * @param nrCustomers nrCustomers The number of customers
 */
virtual void setNrCustomers(unsigned int nrCustomers);
/**
 * Set the number of waiting taxis
 * @param nrTaxis The number of taxis
 */
virtual void setNrTaxis(unsigned int nrTaxis);

};

#endif